<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>单据信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
                <span class="layui-card-header"><i class="layui-icon layui-icon-form"></i>实例相关单据</span>
            </div>
        </script>

        <table class="layui-hide" id="HistoryTasksTableId" lay-filter="currentTableFilter"></table>
        <!--分页-->
        <div class="layui-table-page layui-border-box">
            <div id="barcon" class="page_div" name="barcon"></div>
        </div>

    </div>
</div>
<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="../js/ManualPaging.js"></script>
<script>
    layui.use(['form', 'table'], function () {
        var table = layui.table;
        var param = window.location.href.split("=")[1];
        var insTb = table.render({
            elem: '#HistoryTasksTableId',
            toolbar: '#toolbarDemo',
            defaultToolbar: [''],
            url: ''+publicurl+'bussiness/findBussinessForm?myinstanceid=' + param,
            parseData: function(res){ //res 即为原始返回的数据
                //处理时间
                // for(var i = 0 ; i< res.obj.length ; i++){
                //     for(k in res.obj[i]) {
                //         res.obj[i]["time"] = renderTime(res.obj[i].time)
                //         res.obj[i]["startTime"] = renderTime(res.obj[i].startTime)
                //         res.obj[i]["createTime"] = renderTime(res.obj[i].createTime)
                //     }
                // }
                return {
                    "code": res.status, //解析接口状态,默认成功是0
                    "msg": res.msg, //解析提示文本
                    "count": res.obj.length, //解析数据长度
                    "data": res.obj //解析数据列表
                };
            },
            cols: [[
                {type: "checkbox", width: 50,align:"left"},
                {field: 'task_key', width: 200, title: '任务编号',align:"left"},
                {field: 'form_name', width: 200, title: '单据名称',align:"left"},
                {field: 'status', width: 200, title: '单据状态',align:"left"},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 10,
            page: false,
            skin: 'line',
            // id:'HistoryTasksTableId',
            done:function (res, curr, count) {
                if(res.code==1){
                    layer.alert(res.msg+'<br>'+res.data, {
                        icon: 2,
                        title:"提示"
                    });
                }
                if(count>0){
                    goPage(1);
                }
            }
        });

    });
</script>

</body>
</html>